home *** CD-ROM | disk | FTP | other *** search
Korn shell script | 1994-04-24 | 1.4 KB | 50 lines |
- #!/usr/bin/ksh
- MY_SHELL='/bin/Rsh'
- FORTUNE='/usr/games/fortune'
- TERM=console
- mesg n
-
- sh /etc/profile
- MY_SHELL='/bin/Rsh'
- clear
- dialog --menu " *******Welcome to `hostname`*******\n\n Enter Choice:\n" 21 60 10 \
- "1" "Usenet news" \
- "2" "Internet mail" \
- "3" "Internet talk" \
- "4" "Gnu's Bourne Again Shell" \
- "5" "Gnu's EMACS environment" \
- "6" "XWindow environment (MUST be on console to do so!)" \
- "7" "Note to SysAdmin" \
- "8" "Exit (i.e., logout)" \
- "9" "New users read this!" 2>/tmp/mychoice
- chmod ugoa+w /tmp/mychoice
-
- #this lets the user choose who they wanna talk to.
- dotalk() {
- dialog --title TALK: --inputbox "to whom?" 10 30 2>/tmp/talkchoice
- talk `cat /tmp/talkchoice`
- rm -f /tmp/talkchoice
- exec $MY_SHELL
- }
-
- #echo -n ' Your Choice: '
- choice=`cat /tmp/mychoice`
- #read choice
- clear
- case ${choice:-0} in
- 0) (dialog --infobox "what?" 3 20; sleep 1); exec $MY_SHELL ;;
- 1) (trn -r 2>/dev/null); exec $MY_SHELL ;;
- 2) (elm); exec $MY_SHELL ;;
- 3) dotalk; exec $MY_SHELL ;;
- 4) echo 'You are now in bash; type "exit" to return to the menu';
- echo '';
- (bash -login); exec $MY_SHELL ;;
- 5) (emacs -nw); exec $MY_SHELL ;;
- #5) (clear;echo ' ';$FORTUNE;echo '';echo 'hit enter key...';read junk); $MY_SHELL ;;
- 6) (exec startx) ; exec $MY_SHELL ;;
- 7) (elm root); exec $MY_SHELL ;;
- 8) (rm -f /tmp/mychoice) ; exit ;;
- 9) (echo 'choose 6 & ask sysAdmin about account info...'; read junk); exec $MY_SHELL ;;
- *) (rm -f /tmp/mychoice); exec $MY_SHELL ;;
- esac
-